const order = {
  state: {
    orderListPage: 1,
    orderStatus: '',
    logisticStatus: '',
    orderType: '',
    tradeType: '',
    name: ''
  },
  mutations: {
    SAVE_ORDER_LIST_PAGE: (state, page) => {
      state.orderListPage = page
    },
    SAVE_ORDER_STATUS: (state, status) => {
      state.orderStatus = status
    },
    SAVE_LOGISTIC_STATUS: (state,status) => {
        state.logisticStatus = status
    },
    SAVE_ORDER_TYPE: (state,orderType) => {
      state.orderType = orderType
    },
    SAVE_TRADE_TYPE: (state,tradeType) => {
      state.tradeType = tradeType
    },
    SAVE_SEARCH_NAME: (state,orderId) => {
      state.name = orderId
    }
  },
  actions: {
    saveOrderListPage({commit}, page) {
      commit('SAVE_ORDER_LIST_PAGE', page)
    },
    saveOrderStatus({commit},status){
        commit('SAVE_ORDER_STATUS',status)
    },
    saveLogisticStatus({commit},status){
        commit('SAVE_LOGISTIC_STATUS', status)        
    },
    saveOrderType({commit},status){
      commit('SAVE_ORDER_TYPE', status)        
    },
    saveTradeType({commit},tradeType){
      commit('SAVE_TRADE_TYPE', tradeType)        
    },
    saveSearchName({commit},orderId){
      commit('SAVE_SEARCH_NAME', orderId)        
    }
  }
}

export default order